#ifndef UPPERSETTINGWIDGET_H
#define UPPERSETTINGWIDGET_H

#include "touchbutton.h"
#include <QPushButton>
#include <QTreeWidget>
#include <QWidget>
#include <models/databasemanager.h>

class UpperSettingWidget:public QWidget
{
    Q_OBJECT
public:
    UpperSettingWidget(QWidget *parent = nullptr);
    virtual ~UpperSettingWidget();
protected:
    void initUI();
    void saveData();
    void addSubItem(QTreeWidgetItem *pParentItem = NULL, int nParentID = 0);
    QTreeWidgetItem *addNewRow(Command cmd, QTreeWidgetItem *pParentItem = NULL);
    QList<Command> getItemData(QTreeWidgetItem *item,int nParentID,  int nID);
    void hideEvent(QHideEvent *event);

private:
    TouchButton * m_pNewButton;
    QTreeWidget * m_pTree;

};

#endif // UPPERSETTINGWIDGET_H
